/**
 * LogScoreFreezeService.java
 * Copyright(C) 1949++ 中华人民共和国
 * 深圳市盛开互联网金融顾问有限公司.
 * All rights reserved.
 * E-mail:server@skjr.net
 * SKDate:2017-11-16 17:28:58
 */
package com.huamao.zh.service.impl;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.huamao.zh.base.PageWrapper;
import com.huamao.zh.mapper.LogScoreFreezeMapper2;
import com.huamao.zh.model.LogScoreFreeze;
import com.huamao.zh.service.LogScoreFreezeService;

@Service
@Transactional
public class LogScoreFreezeServiceImpl2 implements LogScoreFreezeService {

	@Autowired
	private LogScoreFreezeMapper2 logScoreFreezeMapper;

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreFreeze add(LogScoreFreeze logScoreFreeze) throws Exception {
		logScoreFreezeMapper.add(logScoreFreeze);
		return logScoreFreeze;
	}

	public LogScoreFreeze add(int type, int fromId, int userId, String orderNo, BigDecimal preScore, int scoreType,
			BigDecimal getScore, String remark) throws Exception {
		LogScoreFreeze logScore = new LogScoreFreeze();
		logScore.setType(type);
		logScore.setFromId(fromId);
		logScore.setUserId(userId);
		logScore.setOrderNo(orderNo);
		logScore.setPreScore(preScore);
		logScore.setScoreType(scoreType);
		logScore.setScore(getScore);
		logScore.setRemark(remark);
		logScore.setDataFlag(1);
		logScore.setCreateTime(new Date());
		logScoreFreezeMapper.add(logScore);
		return logScore;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreFreeze addSelective(LogScoreFreeze logScoreFreeze) throws Exception {
		logScoreFreezeMapper.addSelective(logScoreFreeze);
		return logScoreFreeze;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int delete(Map<String, Object> map) {
		return logScoreFreezeMapper.delete(map);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int update(LogScoreFreeze logScoreFreeze) throws Exception {
		return logScoreFreezeMapper.update(logScoreFreeze);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public int updateSelective(LogScoreFreeze logScoreFreeze) throws Exception {
		return logScoreFreezeMapper.updateSelective(logScoreFreeze);
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public LogScoreFreeze get(Integer id) {
		LogScoreFreeze logScoreFreeze = logScoreFreezeMapper.get(id);
		return logScoreFreeze;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public PageWrapper<LogScoreFreeze> search(PageWrapper<LogScoreFreeze> pageWrapper) {
		List<LogScoreFreeze> logScoreFreezes = logScoreFreezeMapper.search(pageWrapper);
		pageWrapper.setList(logScoreFreezes);
		return pageWrapper;
	}

	/**
	 * 功能说明： Author： SKDate:2017-11-16 17:28:58
	 */
	public List<LogScoreFreeze> queryList(Map<String, Object> map) {
		return logScoreFreezeMapper.queryList(map);
	}

	@Override
	public int queryListCount(Map<String, Object> freezeMap) {
		return logScoreFreezeMapper.queryListCount(freezeMap);
	}
}